<?php echo $this->translate('Catalog'); ?>

<?php function renderChildren($category, $view){ ?>
    <?php if ($category['level']) : ?>
    <li>
            <a href="<?php
            echo $view->url(array('module' => 'catalog',
                                  'controller'=>'category',
                                  'action'=>'index',
                                  'category_id'=>$category['id']),
                'default', true)
                ?>"><?php echo $category['title'] ; ?></a>
    <?php endif ?>
        <?php if ($category->getNode()->hasChildren()): ?>
            <ul>
                <?php foreach ( $category->getNode()->getChildren() as $child ): ?>
                    <?php renderChildren($child, $view); ?>
                <?php endforeach;?>
            </ul>
        <?php endif; ?>
    <?php if ($category['level']) : ?>
    </li>
    <?php endif ?>
<?php } ?>

<?php renderChildren($this->rootCategory, $this); ?>